package com.yundasys.lab12java.concurrent;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * @PACKAGE_NAME: com.yundasys.lab12java.concurrent
 * @NAME: HashMapTest
 * @USER: jiangta
 * @DATE: 2023/1/29
 * @TIME: 8:46 上午
 * @PROJECT_NAME: springboot-labs
 */
public class HashMapTest {

    public static void main(String[] args) {

        Map<String, String> map = new HashMap<>();

        for (int i = 0; i < 30; i++) {
            new Thread(() -> {
                map.put(Thread.currentThread().getName(), UUID.randomUUID().toString().substring(0, 8));
                System.out.println(map);
            }, String.valueOf(i)).start();
        }
    }
}
